<?php

class Datagrid_Renderizador_Imagem implements Datagrid_Renderizador {
	public function render(Datagrid_Campo $campo, Modelo $model){
		$path = $campo->GetParametros("caminho");
		$metodo = "get_" . $campo->GetNome();
		$img_name = $model->$metodo();
		$app_folder = (APP_FOLDER) ? "/" . APP_FOLDER : '';
		$app_folder = str_replace("/backend", '', $app_folder);

		$img = "<a href='{$app_folder}{$path}{$img_name}' class='light'><img src='{$app_folder}{$path}{$img_name}' alt='imagem' width='100' height='100' border='0' /></a>";
		return $img;
	}
}